cc_binary(
    name = 'a_binary',
    srcs = ['a.cc'],
)

bundle(
    name = 'a',
    srcs = [
      'a.txt',
    ],
    prefix = 'asdf',
    pattern = '^a\.txt$',
    replace = 'b.txt',
)

bundle(
    name = 'b',
    deps = [
      ':a',
      ':a_binary',
    ],
    prefix = 'asdf',
    pattern = '^a_binary$',
    replace = 'a',
)
